import api from '@/api/proxy'


// 获取文档列表
export const getFileList = (params) => {
    return api.get('/file/list', { params })
}

// 删除文档
export const deleteFile = (fileId) => {
    return api.delete(`/file/delete/${fileId}`)
}

// 上传文档
export const uploadFile = (knowbaseName, knowbaseId, file) => {
    const formData = new FormData()
    formData.append('file', file)
    return api.post('/file/upload', formData, {
        params: {
            knowbase_name: knowbaseName,
            kb_id:knowbaseId
        },
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

//启动文件解析
export const startParsing = (requestData) => {
    return api.post(`/file/parse/start`,requestData)
}